﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;
namespace QLVeChuyenBay
{
    public partial class frmSanBay : Form
    {
        public frmSanBay()
        {
            InitializeComponent();
        }
        SanBayBUS obj = new SanBayBUS();
        private void frmSanBay_Load(object sender, EventArgs e)
        {
            List<SanBayDTO> ds = obj.GetAll();
            for (int i = 0; i < ds.Count; i++)
            {
                dgvSanBay.Rows.Add(i + 1, ds[i].MaSanBay, ds[i].TenSanBay);
            }

            cbMaSanBay.DataSource = ds;
            cbMaSanBay.ValueMember = "MaSanBay";
            cbMaSanBay.DisplayMember = "MaSanBay";
            cbMaSanBay.SelectedIndex = -1;
            cbTenSanBay.DataSource = ds;
            cbTenSanBay.ValueMember = "TenSanBay";
            cbTenSanBay.DisplayMember = "TenSanBay";
            cbTenSanBay.SelectedIndex = -1;
            // cbTuyenBay.DisplayMember = "MaTB";
            //cbTuyenBay.ValueMember = "MaTB";
            //cbTuyenBay.SelectedIndex = -1;
        }

        private void btnThoát_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn thoát?", "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                this.Close();
            }
        }

        private void btnThem_Click(object sender, EventArgs e)
        {

        }

        private void btnCapNhat_Click(object sender, EventArgs e)
        {

        }

        private void btnXoa_Click(object sender, EventArgs e)
        {

        }

       
        
    }
}
